<template>
  <div class="score-page-header">
    <div class="page-header">
      <h1>{{ title }}</h1>
      <div class="actions">
        <el-button type="primary" @click="handleScoreEntry">
          <el-icon><EditPen /></el-icon> 成绩录入
        </el-button>
        <slot name="import-button">
          <!-- 导入按钮插槽 -->
        </slot>
      </div>
    </div>
  </div>
</template>

<script setup>
import { EditPen } from '@element-plus/icons-vue'

defineProps({
  title: {
    type: String,
    default: '成绩管理'
  }
})

const emit = defineEmits(['score-entry'])

const handleScoreEntry = () => {
  emit('score-entry')
}
</script>

<style scoped>
.score-page-header {
  margin-bottom: 20px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.page-header h1 {
  margin: 0;
  color: #303133;
  font-size: 24px;
  font-weight: 500;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
</style>
